﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.IO;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
using System.Web.Configuration;
using System.Security.Cryptography;
using System.Text;
using System.Drawing;
using System.Drawing.Imaging;
using System.ComponentModel;

namespace HospitalSystem
{
    public partial class regfamily2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            String ShowValue = (string)Session["CID"];
            Label4.Text = ShowValue;
            String ShowValue2 = (string)Session["LastName"];
            Label3.Text = ShowValue2;

            String ShowValue3 = (string)Session["FirstName"];
            Label2.Text = ShowValue3;
            show_Image();
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/healthinfo.aspx");
        }


        protected void show_Image()
        {
            string sj = "";
            string constr = WebConfigurationManager.ConnectionStrings["strconnection"].ConnectionString;
            SqlConnection conn = new SqlConnection(constr);


            SqlCommand CmdSql2 = new SqlCommand("SELECT FilePath FROM [ImageDek] where Iddek=@CID", conn);
            conn.Open();
            CmdSql2.Parameters.AddWithValue("@CID", Label4.Text);

            SqlDataReader reader2 = CmdSql2.ExecuteReader();

            if (reader2.Read())
            {
                sj = reader2["FilePath"].ToString();
            }
            else
            {
                sj = "~/pic/profile/nopic.jpg";
            }
            conn.Close();
            reader2.Close();


            Image1.ImageUrl = (sj);
        }
    }
}